<template>
  <van-tabbar v-model="active">
    <!-- 示例tabbar -->
    <van-tabbar-item
      :name="item.route"
      :to="item.route"
      :icon="item.icon"
      v-for="item in tabLists"
      :key="item.id">{{item.text}}</van-tabbar-item>
  </van-tabbar>
</template>

<script>
export default {
  data () {
    return {
      active: '/home',
      tabLists: [
        {
          text: 'Home',
          route: '/home',
          icon: 'home-o',
          id: 1
        },
        {
          text: 'About',
          route: '/about',
          icon: 'search',
          id: 2
        }
      ]
    }
  },
  created () {
    // 防止刷新 active 重置
    this.active = window.location.pathname
  }
}
</script>

<style>

</style>
